package com.oocl.im.action.impl;

import com.oocl.im.action.IAction;
import com.oocl.im.entity.Protocol;

import java.io.ObjectOutputStream;
import java.util.HashMap;
import java.util.Map;

import com.oocl.im.outputstream.NetOutput;
import com.oocl.im.constants.ClientMaintenance;
import com.oocl.im.constants.Constants;
import com.oocl.im.handle.IHandle;

public class LogoutAction implements IAction {
	
	ObjectOutputStream oos;
	
	public LogoutAction(ObjectOutputStream oos) {
		super();
		this.oos = oos;
	}

	public void execute(Protocol protocol) {
		Map<String,Object> params = new HashMap<String, Object>();
		params.put(Constants.FROM,ClientMaintenance.client.getAccount());
		Protocol request = new Protocol(Constants.LOGOUT, params);
		NetOutput netOutput = new NetOutput(oos);
		netOutput.write(request);

	}

	
	
}
